<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>入口费用详细</el-breadcrumb-item>
    </el-breadcrumb>

    <!-- 卡片视图区域 -->
    <el-card>
      <el-row :gutter="20">
        <el-col :span="8">
          <el-input placeholder="请输入内容" v-model="queryInfo.searchText"
            ><el-button
              slot="append"
              icon="el-icon-search"
              @click="getSpend1List()"
            ></el-button> </el-input
        ></el-col>
        <el-col :span="4">
          <el-button type="primary" @click="addDialogVisible = true"
            >出库</el-button
          >
        </el-col>

      </el-row>
      <el-divider><i class="el-icon-s-check"></i></el-divider>
      <!-- 申请表区域 -->
      <el-table :data="spend1list" border stripe>
        <el-table-column type="index" label="#"></el-table-column>
        <el-table-column label="申请编号" prop="Inno1"></el-table-column>
        <el-table-column label="物品类别" prop="Object1"></el-table-column>
        <el-table-column label="入口费用" prop="Spend1"></el-table-column>
        
          
        
      </el-table>
      <el-pagination
        small
        layout="prev, pager, next"
        :total="50"
        :current-page="queryInfo.pagenum"
        :page-size="queryInfo.pagesize"
      >
      </el-pagination>
    </el-card>

    

    

    <!-- 删除申请 -->
    <el-dialog
      title="删除申请信息"
      :visible.sync="deleteDialogVisible"
      width="50%"
      @close="deleteDialogClose()"
    >
    <el-form
        :model="deleteForm"
        :rules="deleteFormRulers"
        ref="deleteFormRef"
        label-width="110px"
      >
        <el-form-item label="申请编号" prop="inno1">
          <el-input v-model="deleteForm.inno1"></el-input>
        </el-form-item>
        
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="deleteDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="showDeleteDialog"
          >确定删除</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>
 

<script>
export default {
  name: "spend1",
  data() {
    //获取申请表的参数
    return {
      queryInfo: {
        searchText: "",
        pagenum: 1,
        pagesize: 2,
      },
      spend1list: [],
      total: 0,
      
      
      // 控制对话框显示与隐藏
      deleteDialogVisible: false,
      //删除申请的表单
      deleteForm: {
        inno1: "",
      },
      //添加表单的验证对象
      deleteFormRulers: {
        inno1: [{ required: true, message: "请输入编号", trigger: "blur" }],
      },
    };
  },
  created() {
    this.getSpend1List();
  },
  methods: {
    async getSpend1List() {
      const { data: res } = await this.$http.get("/spend1", {
        parmas: this.queryInfo,
      });
      if (res.code != 20000) {
        return this.$message.error("获取用户列表失败");
      } else {
        this.spend1list = res.data.value;
        this.total = res.data.total;
        console.log(res);
      }
    },
    // 监听对话框是否关闭
   
    deleteDialogClose(){
      this.$refs.deleteFormRef.resetFields();
    },
    
  },
};
</script>

<style>
.el-breadcrumb {
  margin-bottom: 20px;
  font-size: 12px;
}

.el-card {
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0) !important;
}
</style>